#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
import os
import dbus
import dbus.service
import dbus.glib
import gobject
from managers.agent import *

if __name__=='__main__':
    # Saving DBUS envirnoment
    os.environ['DBUS_SESSION_BUS_ADDRESS'] = 'unix:path=/var/run/dbus/system_bus_socket'

    # Connection to DBUS
    session_bus = dbus.SessionBus()
    name = dbus.service.BusName("org.security.agent", bus=session_bus)
    agent = Agent(name)

    print "Dispatcher activated..."
    mainloop = gobject.MainLoop()
    mainloop.run()
